import service from '@/utils/request'

const GoodsApi = {
  listGoods: function (data) {
    return service.get('goods/page', { params: data })
  },
  listByParam: function (data) {
    return service.get('goods/listByParam', { params: data })
  },
  addGoods: function (data) {
    return service.post('goods', data)
  },
  addCombo: function (data) {
    return service.post('goods/addCombo', data)
  },
  editGoods: function (data) {
    return service.put('goods', data)
  },
  updateGoods: function (data) {
    return service.put('goods/updateGoods', data)
  },
  deleteGoods: function (data) {
    return service.put('goods/delete', data)
  },
  getGoodsInfo(data) {
    return service.get('goods', { params: data })
  },
  batchUpdateSaleState: function (data) {
    return service.put('goods/batchUpdateSaleState', data)
  },
  getGoodsList(data) {
    return service.get('goods/listIdName', { params: data })
  },
  getMultipleGoods(data) {
    return service.get('goods/listGoods', { params: data })
  },
  startUsingGoods(data) {
    return service.put('goods/startUsingGoods', data)
  },
  batchDelete(data) {
    return service.put("goods/batchDelete", data)
  },
  batchSetDepart(data) {
    return service.put("goods/batchSetDepart", data)
  },
  goodsTree:function(data){
    return service.get('goods/idNameTree', {params:data})
  },
}

export default GoodsApi
